<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function ma(num1, num2) {
            return num1 > num2 ? num1 : num2;
        }
        var m = ma(1, 2);
        console.log(m);

        function getmax(arr) {
            var max = 0;
            for (var i = 0; i < arr.length; i++) {
                max = max > arr[i] ? max : arr[i];
            }
            return max;
        }

        console.log(getmax([5, 2, 99, 101, 67, 77]));
        //没有return返回的是undefined
    </script>
</head>

<body>

</body>

</html>